<?php

namespace app\admin\controller;

use app\common\HasFormatEnum;
use app\enums\ConfigEnums;
use Iyuu\BittorrentClient\ClientEnums;
use plugin\admin\app\controller\Base;
use support\Request;
use support\Response;

/**
 * 枚举控制器
 */
class EnumsController extends Base
{
    use HasFormatEnum;

    /**
     * 客户端类型
     * @param Request $request
     * @return Response
     */
    public function client(Request $request): Response
    {
        return $this->success('ok', $this->formatSelectEnum(ClientEnums::toArray()));
    }

    /**
     * 自定义配置枚举
     * @param Request $request
     * @return Response
     */
    public function config(Request $request): Response
    {
        return $this->success('ok', $this->formatSelectEnum(ConfigEnums::toArray()));
    }
}
